<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
	<title>百朋后台管理系统</title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/demo.css">
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/easyui/jquery.easyui.min.js"></script>
</head>
<body>
	<div class="invest_table">
		<table id="default_table" title="订单列表" style="width:100%;min-height:372px;"
			data-options="
				fitColumns:true,
				rownumbers:true,
				singleSelect:true,
				autoRowHeight:false,
				url:'../../borrow/borrowoverdue/borrowoverdue_main',
				pagination:true,
				pageSize:10,toolbar:'#tb'
			"
		>
			<thead>
				<tr>
					<th field="binfo_id" width="10%" align="center">借款编号</th>
					<th field="fac_simple_name" width="10%" align="center">商户简称</th>
					<th field="cust_name" width="8%" align="center">客户姓名</th>
					<th field="fund_balance" width="8%" align="center">账户余额</th>
					<th field="period_number" width="5%" align="center">期数</th>
                    <th field="start_date" width="7%" align="center">起始时间</th>
					<th field="end_date" width="7%" align="center">还款日</th>
					<th field="recover_money" width="7%" align="center">应还款额</th>
					<th field="action" width="7%" align="center" formatter="format_overdue">滞纳金</th>
					<th field="overdue_day" width="5%" align="center">逾期天数</th>
					<th field="repay_status" width="8%" align="center">状态</th>
				</tr>
			</thead>
		</table>
	</div>
	<div id="tb" style="padding:5px;height:auto">
		<form action="" method="post" id="searchTable">
			<div>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				还款状态
                <select class="easyui-combobox" id="repay_status" panelHeight="auto" data-options="editable:false">
                    <option value="">请选择</option>
                    <option value="1">已还款</option>
                    <option value="2">未还款</option>
                </select>
				<a href="javascript:;" onclick="submitSearch();" class="easyui-linkbutton" iconCls="icon-search">查询</a>
			</div>
		</form>
	</div>

	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript">
		$(function() {
            $("#default_table").datagrid();
		});
        function format_overdue(value,row,index){
            var day=row.overdue_day;
            var money=row.recover_money;
            var value=0;
            if(day<=30&&day>1){
                value=money*day*3/1000;
            }else if(day>30&&day<=60){
                value=money*30*3/1000+money*(day-30)*4/1000;
            }else if(day>60){
                value=money*30*3/1000+money*30*4/1000+money*(day-60)*5/1000;
            }
            return value.toFixed(2);
        }
        function submitSearch(){
            $('#default_table').datagrid('load',{
                repay_status: $("#repay_status").combobox('getValue')
            });
        }
	</script>
</body>
</html>